package GUI;


import java.awt.BorderLayout;

import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

import Main.Main;

public class Desktop extends JPanel{
	private static final long serialVersionUID = 1L;
	private JMenuBar menuBar;
	private JDesktopPane desktopPane;
	private JMenu toolMenu;
	private JMenu viewMenu;
	private ViewItem grapherViewItem;
	private JInternalFrame grapherFrame;
	private Main grapher;
	
	public Desktop(){
		setupLayout();
	}
	
	protected void setupLayout(){
		setLayout(new BorderLayout());
		
		desktopPane = new JDesktopPane();
		add(desktopPane,BorderLayout.CENTER);
		
		menuBar = new JMenuBar();
		
		toolMenu = new JMenu("Tools");
		menuBar.add(toolMenu);
		
		viewMenu = new JMenu("View");
		menuBar.add(viewMenu);
		
		add(menuBar,BorderLayout.NORTH);
		
		grapherFrame = new JInternalFrame();
		grapherFrame.setSize(Main.windowXSize, Main.windowYSize);
		grapherFrame.setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
		grapherFrame.setClosable(true);
		
		grapherViewItem = new ViewItem(grapherFrame,"grapher");
		viewMenu.addMenuListener(grapherViewItem);
		viewMenu.add(grapherViewItem);
		
		desktopPane.add(grapherFrame);
		
		grapher = new Main();
		grapherFrame.add(grapher);
		
		
		
		
	}
}
